package com.llt.ai.tools;

import com.llt.api.domain.dto.QuestionQueryDTO;
import com.llt.api.domain.vo.QuestionDetailVO;
import com.llt.api.service.RemoteUserService;
import com.llt.common.core.domain.R;
import com.llt.common.core.domain.TableDataInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: llt
 * @Date: 2025-08-06 上午10:11
 */
@Service
@RequiredArgsConstructor
public class QuestionAiTool {

    private final RemoteUserService userService;

    @Tool(name = "获取题目列表", description = "用于获取题目列表。初次调用时无需询问关键词或难度，若参数为空也应直接调用；" +
            "调用完成后可提示用户是否需要按关键词或难度筛选。")
    public TableDataInfo searchQuestions(@ToolParam(description = "关键词") QuestionQueryDTO dto) {
        return userService.list(dto);
    }
    @Tool(name = "获取题目详情", description = "用于获取题目详情。")
    public R<QuestionDetailVO> detail(@ToolParam(description = "题目id") Long questionId) {
        return userService.detail(questionId);
    }
}
